//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#include "Node.h"
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
template <class T>
TNode <T>::TNode():info(NULL), previous(NULL), next(NULL) {}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
template <class T>
TNode <T>::TNode(T info) {
  this->info      = new T (info);
  this->previous  = NULL;
  this->next      = NULL;
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
template <class T>
TNode <T>::TNode(T* info) {
  this->info      = info;
  this->previous  = NULL;
  this->next      = NULL;
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
template <class T>
TNode <T>::~TNode() {
  if (this->info) delete this->info;
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
template <class T>
T* TNode <T>::Info() {
  return this->info;
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
template <class T>
void TNode <T>::Info(T* info) {
  if (info && this->info) delete this->info;
  this->info = info;
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
template <class T>
void TNode <T>::Info(T info) {
  if (this->info) delete this->info;
  this->info = new T;
  *(this->info) = info;
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
  template <class T>
  TNode <T>* TNode <T>::Next() {
    return this->next;
  }
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
template <class T>
void TNode <T>::Next(TNode <T>* next) {
  this->next = next;
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
template <class T>
void TNode <T>::Next(const TNode <T>& next) {
  this->next = &next;
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
template <class T>
TNode <T>* TNode <T>::Previous() {
  return this->previous;
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
template <class T>
void TNode <T>::Previous(TNode <T>* previous) {
  this->previous = previous;
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
template <class T>
void TNode <T>::Previous(const TNode <T>& previous) {
  this->previous = &previous;
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
template <class T>
TNode <T> TNode<T>::operator=(const TNode <T>& node) {
  if (this->info) delete this->info;
  this->info     = node.info;
  this->next     = node.next;
  this->previous = node.previous;
  return *this;
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
